package com.wolfcode.jersey;
 
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.core.MediaType;
 
public class TestClient {
 
    public static void main(String[] args) {
        String url = "http://localhost:8088/webapi";
        Client client = ClientBuilder.newClient();
        WebTarget webTarget = client.target(url).path("hello");
        Builder builder = webTarget.request(MediaType.TEXT_PLAIN);
        String result = builder.get(String.class);
        System.out.println(result);
    }
}